package com.wzcl.app.service.impl;

import com.wzcl.app.dao.model.TaskEvaluateScore;
import com.wzcl.app.dao.repository.TaskEvaluateScoreRepository;
import com.wzcl.app.service.TaskEvaluateScoreService;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author beingven
 * @Description TODO
 * @createTime 2021年01月23日 14:20:00
 */
@Service
public class TaskEvaluateScoreServiceImpl implements TaskEvaluateScoreService {
    @Resource
    private TaskEvaluateScoreRepository taskEvaluateScoreRepository;

    @Override
    public TaskEvaluateScore retrieveEvaluateById(Integer taskId) {
        String phone = SecurityContextHolder.getContext().getAuthentication().getName();
        TaskEvaluateScore taskEvaluateScore = taskEvaluateScoreRepository.findByTaskId(taskId, phone);
        return taskEvaluateScore;
    }
}
